﻿<!DOCTYPE html>

<html>
<head>
    <!-- This forces IE to not use compatibility mode, which Kudu is broken for -->
    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
    <link rel="icon" type="image/x-icon" href="/favicon.ico" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width" charset="utf-8" />
    <title>@Page.Title</title>
    <link href="/Content/Styles/bootstrap.min.css" rel="stylesheet" />
    <script type="text/javascript" src="/Content/Scripts/jquery-2.1.0.min.js"></script>
    <script type="text/javascript" src="/Content/Scripts/bootstrap.min.js"></script>
    @if (Kudu.Core.Environment.IsAzureEnvironment())
    {
        <script type="text/javascript" src="/Content/Scripts/NavigateToInstance.js"></script>
    }

    @RenderSection("PageHead", required: false)
    <style type="text/css">
        body {
            padding-top: 60px;
        }
    </style>
    <script type="text/javascript">
        appRoot = "@System.Web.VirtualPathUtility.ToAbsolute("~/")";
        $(document).ajaxError(function (event, jqxhr, settings, thrownError) {
            if (jqxhr.status === 403) {
                $('#403-error-modal').modal();
            }
        });
    </script>
    @if (Kudu.Core.Environment.IsAzureEnvironment())
    {
        <script>
            $.currInst = "@System.Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID"):(@System.Environment.GetEnvironmentVariable("COMPUTERNAME"))";
        </script>
    }

    @if (Kudu.Core.Helpers.OSDetector.IsOnWindows())
    {
        <script>
            $.serverOS = "windows";
            $.isolation = "pico";
        </script>
    }
    else if (Kudu.Core.Helpers.EnvironmentHelper.IsWindowsContainers())
    {
        <script>
            $.serverOS = "windows";
            $.isolation = "hyperv";
        </script>
    }
    else
    {
        <script>
            $.serverOS = "linux";
            $.isolation = "none";
        </script>
    }
</head>

<body>
    <nav class="navbar navbar-default navbar-fixed-top navbar-inverse" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="~/" style="padding-top: 13px"><img src="/Content/Images/Kudu.svg" style="width: 50px; height: 18px"></a>
            </div>
            <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li><a href="~/Env.cshtml">Environment</a></li>
                    @if (Kudu.Core.Helpers.OSDetector.IsOnWindows() && !Kudu.Core.Helpers.EnvironmentHelper.IsWindowsContainers())
                    {
                        <li class="dropdown">
                            <a href="#" data-toggle="dropdown" class="dropdown-toggle">Debug console <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="~/DebugConsole">CMD</a></li>
                                <li><a href="~/DebugConsole/?shell=powershell">PowerShell</a></li>
                            </ul>
                        </li>
                        <li><a href="~/ProcessExplorer/">Process explorer</a></li>
                        <li class="dropdown">
                            <a href="#" data-toggle="dropdown">Tools <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="~/api/dump">Diagnostic dump</a></li>
                                <li><a href="~/azurejobs/">WebJobs dashboard</a></li>
                                <li><a href="~/WebHooks">Web hooks</a></li>
                                <li><a href="~/ZipDeployUI">Zip Push Deploy</a></li>
                                <li><a href="~/api/deploymentscript">Download deployment script</a></li>
                                <li><a href="~/Support">Support</a></li>
                            </ul>
                        </li>
                        <li><a href="~/SiteExtensions/">Site extensions</a></li>
                    }
                    else if (Kudu.Core.Helpers.OSDetector.IsOnWindows() && Kudu.Core.Helpers.EnvironmentHelper.IsWindowsContainers())
                    {
                        <li><a href="~/DebugConsole">Console</a></li>
                        <li><a href="~/webssh/host">SSH</a></li>
                        <li><a href="~/api/logstream">Log stream</a></li>
                    }
                    else
                    {
                        <li class="dropdown">
                            <a href="#" data-toggle="dropdown" class="dropdown-toggle">Debug console <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li><a href="~/DebugConsole/Default.cshtml">Bash</a></li>
                                <li><a href="~/webssh/host">SSH</a></li>
                            </ul>
                        </li>
                    }

                    @if (Kudu.Core.Environment.ShouldShowInstanceUI())
                    {
                        <li class="dropdown" id="instances-li" style="display:none">
                            <a href="#" data-toggle="dropdown" class="dropdown-toggle"><span id="instance-drop-down-text"></span><b class="caret"></b></a>
                            <ul class="dropdown-menu instances_tab_options_cls" id='instances_tab_options'></ul>
                        </li>
                    }
                </ul>
                @{
                    var email = Request.Headers["X-MS-CLIENT-PRINCIPAL-NAME"];
                    if (email != null && email.Contains("@"))
                    {
                        <ul class="nav navbar-nav navbar-right" style="position: fixed; right: 65px;">
                            <li class="dropdown">
                                <img src="/Content/Images/avatar.png" style="height: 50px; padding-top: 1px" />
                                <a href="#" data-toggle="dropdown" style="display: inline">@email</a>
                                <ul class="dropdown-menu">
                                    <li><a href="/logout">Logout</a></li>
                                </ul>
                            </li>
                        </ul>
                    }
                }
            </div>
        </div>
    </nav>

    <!-- 403 error modal -->
    <div class="modal fade" id="403-error-modal" tabindex="-1" role="dialog" aria-labelledby="errorTitle" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title" id="errorTitle">Session expired</h4>
                </div>
                <div class="modal-body">
                    Your session has expired. Please refresh your browser.
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                </div>
            </div>
        </div>
    </div>

    @RenderBody()
</body>

</html>
